package org.ant.gui.panes;

import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JTabbedPane;

import org.ant.ctrl.CodesManager;

public class SideTabbedPane extends JTabbedPane implements ActionListener {

	private ClassTreePane classPane;
	
	public SideTabbedPane() {
		super();
		init();
		loadComponents();
	}

	protected void init() {

	}

	protected void loadComponents() {
		addTab(getClassPane().getName(), getClassPane());
	}

	public ClassTreePane getClassPane() {
		classPane = new ClassTreePane();
		return classPane;
	}

	public void actionPerformed(ActionEvent e) {
		if (e.getSource() instanceof CodesManager) {
			this.removeAll();
			
			addTab(getClassPane().getName(), getClassPane());
		}
	}
}
